import type { postOrPutType } from "@/constants";
import type { IResult } from "@/types/common";
import { getAxios, commonAxiosJson, deleteAxios } from "@/utils/request.js";
/* 回收商品分类 地址 */
const url = "/back/recycle-category";
/* 回收分类数据：获取 回收商品分类信息 */
export const getRecycleCategoryInfo = <T, D>(params?: D): Promise<IResult<T>> => {
  return getAxios<T, D>(url, params);
};
/* 回收分类数据：新增，修改回收商品分类信息 */
export const commonRecycleCategoryInfo = <T, D>(params: D, type: postOrPutType): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url, params, type);
};
/* 回收分类数据：修改回收商品分类 排序 信息 */
export const putRecycleCategorySortInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return commonAxiosJson<T, D>(url + "/update-sort", params, "PUT");
};
/* 回收分类数据：删除 回收商品分类信息 */
export const deleteRecycleCategoryInfo = <T, D>(params: D): Promise<IResult<T>> => {
  return deleteAxios<T, D>(url, params);
};
